From d93275a1bbeddc5d0512a17c6418d2f7348648dd Mon Sep 17 00:00:00 2001 From: "bren@br260.wolfson.cam.ac.uk" Date: Thu, 21 Apr 2005 12:07:43 +0000 Subject: [PATCH] bitkeeper revision 1.1354 (4267978fFQb5kQkxkvTFxgEKkOUzLQ) Enable the ProcFS part of grant table only when CONFIG_PROC_FS is defined. This is also necessary for separate driver domains that contain block device backend driver and operate in kernel-mode only (thus ProcFS turned off). Signed-off-by: Bin Ren --- linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c b/linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c index 28b2ba6fc7..0ae2ac6548 100644 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/gnttab.c @@ -53,10 +53,6 @@ static grant_ref_t gnttab_free_head; static grant_entry_t *shared; -/* /proc/xen/grant */ -static struct proc_dir_entry *grant_pde; - - /* * Lock-free grant-entry allocator */ @@ -243,6 +239,14 @@ gnttab_release_grant_reference( grant_ref_t *private_head, *private_head = release; } +/* + * ProcFS operations + */ + +#ifdef CONFIG_PROC_FS + +static struct proc_dir_entry *grant_pde; + static int grant_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data) { @@ -319,6 +323,7 @@ static int grant_write(struct file *file, const char __user *buffer, return -ENOSYS; } +#endif /* CONFIG_PROC_FS */ int gnttab_resume(void) { @@ -360,6 +365,7 @@ static int __init gnttab_init(void) for ( i = 0; i < NR_GRANT_ENTRIES; i++ ) gnttab_free_list[i] = i + 1; +#ifdef CONFIG_PROC_FS /* * /proc/xen/grant : used by libxc to access grant tables */ @@ -376,6 +382,7 @@ static int __init gnttab_init(void) grant_pde->read_proc = &grant_read; grant_pde->write_proc = &grant_write; +#endif printk("Grant table initialized\n"); return 0; -- 2.30.2